from tornado.web import Application, StaticFileHandler
import os

import config
from views import index


class Application(Application):
    def __init__(self):
        handlers = [
            (r"/main", index.MainHandler),
            (r"/(.*)", StaticFileHandler, {"path": os.path.join(
                os.path.dirname(__file__), "static"), "default_filename": "index.html"})
        ]
        super().__init__(handlers, **config.settings)